{messages}
{if !count($aItems)}
<div style="text-align:center;">
	{language text='Mod_Video.no_videos_added_yet'}
	<br />
	<br />
</div>
{else}
<div style="text-align:left;">
	{include file="$sRootPath/_blocks/pager_nav_button.html"}
</div>
<table style="width:100%;" cellpadding="4" cellspacing="4">
{foreach from=$aItems item=aItem}

{if $aItem.vid_url}
<tr id="vid_image_{$aItem.vid_id}" style="display:none;">
		<td colspan="3" class="border13">
		<div style="padding:6px; text-align:right;">
			<form target="uploadFrame" action="{url link='public.videos.changethumb'}" id="uploadForm_{$aItem.vid_id}" method="post" enctype="multipart/form-data" >
				<input type="hidden" name="imageid" value="{$aItem.vid_id}" />
			  {language text='Mod_Video.upload_image_video'}: <input type="file" name="image" />
			  <input type="submit" name="act[edit]" value="{language text='submit'}" class="mainmenu6" onmouseover="this.className='mainmenu7';" onmouseout="this.className='mainmenu6';" />
			</form>
			<iframe id="uploadFrame" name="uploadFrame" style="display: none"></iframe>
		</div>		
		</td>
</tr>
{/if}

<form id="editForm_{$aItem.vid_id}" method="post" action="{url link='current'}" onsubmit="xajax_editVideos(xajax.getFormValues('editForm_{$aItem.vid_id}')); return false;">
<tr>
	<td style="text-align:center; width:150px; vertical-align:top;">
		{include file="$sRootPath/_blocks/videostars.html"}
		<br />
		<a href="{url link='public.videos' id=$aItem.vid_id foxseotitle=$aItem.vid_title}">
			{img max_width="120" src="`$sGImageUrl``$aItem.vid_id`.jpg" src_def="design/pic/noimage_120.jpg" alt="" id="mainimage_`$aItem.vid_id`" add_stamp='true'}
		</a>
		<br />
		<br />
		[ <a href="{url link='current' dvideo=$aItem.vid_id}" onclick="return sure();">{language text='Mod_Video.delete'}</a> ]
		
		{if $aItem.vid_url}
		<br />
		<br />
		[ <a href="javascript:void(0);" onclick="new Effect.Appear('vid_image_{$aItem.vid_id}');">{language text='Mod_Video.change_image'}</a> ]
		{/if}
		
	</td>
	<td style="vertical-align:top;">

	<div><input type="hidden" name="val[vid_id]" value="{$aItem.vid_id}" /></div>
	<table style="width:100%;" cellspacing="2" cellpadding="4">
	<tr>
	    <td style="text-align:right;" class="color"><span class="star">*</span> {language text="Mod_Video.add_form_title"}:</td>
	    <td class="border13">
	        <input type="text" name="val[vid_title]" maxlength="40" size="30" onfocus="this.className='inputmain';" onblur="this.className='';" value="{$aItem.vid_title|escape}" />
	    </td>
	</tr>
	{if $aItem.vid_url}
	<tr>
    	<td style="text-align:right;" class="color">{language text='Mod_Video.add_form_stream_from'}:</td>
    	<td class="border13">
			<select name="val[stream_id]" style="width:150px;">
			{foreach from=$aStreamOptions item=aStream}
				<option value="{$aStream.id}"{if $aItem.stream_id == $aStream.id} selected="true"{/if}>{$aStream.name}</option>
			{/foreach}
			</select>
    	</td>
	</tr>
	<tr>
	    <td style="text-align:right;" class="color"><span class="star">*</span> {language text="Mod_Video.add_form_url"}:</td>
	    <td class="border13">
	        <input type="text" name="val[vid_url]" size="30" onfocus="this.className='inputmain';" onblur="this.className='';" value="{$aItem.vid_url}" />
	    </td>
	</tr>
	{/if}
	<tr>
	    <td style="text-align:right;" class="color">{language text='Mod_Video.add_form_category'}:</td>
	    <td class="border13">
	        <select name="val[vid_list_id]" style="width:150px;">
			{foreach from=$aCategories item=aCategory}
			<option value="{$aCategory.list_id}"{if $aItem.vid_list_id == $aCategory.list_id} selected="true"{/if}>{$aCategory.list_name}</option>
			{/foreach}
			</select>
	    </td>
	</tr>
	<tr>
	    <td style="text-align:right;vertical-align:top;" class="color">{language text='Mod_Video.add_form_details'}:</td>
	    <td class="border13">
	        <textarea cols="30" rows="5" name="val[vid_info]">{$aItem.vid_info}</textarea>
	    </td>
	</tr>
	<tr>
	    <td style="text-align:right;" class="color">{language text='Mod_Video.tags'}:</td>
	    <td class="border13">
	        <input type="text" name="val[vid_tags]" size="30" maxlength="100" onfocus="this.className='inputmain';" onblur="this.className='';" value="{$aItem.vid_tags|escape}" />
	    </td>
	</tr>
	</table>

	</td>
</tr>
<tr>
	<td colspan="3">
		<div style="padding:6px; text-align:right;" class="border13">
			<span id="edit_{$aItem.vid_id}" style="font-size:9pt; font-weight:bold; display:none;">
				 {language text='Mod_Video.video_updated'}
			</span>
			<input type="submit" value="{language text='Mod_Video.update_video'}" />
		</div>
		<br />
		<br />
	</td>
</tr>
</form>
{/foreach}
</table>
<div style="text-align:left;">
	{include file="$sRootPath/_blocks/pager_nav_button.html"}
</div>
{/if}